Integrand size = 26, antiderivative size = 66 \[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=\frac {2 \sqrt {a} c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a c \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}} \]
2*c*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))*a^(1/2)/f-2*a*c*tan( f*x+e)/f/(a+a*sec(f*x+e))^(1/2)
Time = 0.53 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.38 \[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=\frac {2 c \sqrt {a (1+\sec (e+f x))} \left (\sqrt {c} \text {arctanh}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {c}}\right )-\sqrt {c-c \sec (e+f x)}\right ) \tan \left (\frac {1}{2} (e+f x)\right )}{f \sqrt {c-c \sec (e+f x)}} \]
(2*c*Sqrt[a*(1 + Sec[e + f*x])]*(Sqrt[c]*ArcTanh[Sqrt[c - c*Sec[e + f*x]]/ Sqrt[c]] - Sqrt[c - c*Sec[e + f*x]])*Tan[(e + f*x)/2])/(f*Sqrt[c - c*Sec[e + f*x]])
Time = 0.35 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.03, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3042, 4392, 3042, 4375, 262, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sqrt {a \sec (e+f x)+a} (c-c \sec (e+f x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {a \csc \left (e+f x+\frac {\pi }{2}\right )+a} \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 4392 |
\(\displaystyle -a c \int \frac {\tan ^2(e+f x)}{\sqrt {\sec (e+f x) a+a}}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -a c \int \frac {\cot \left (e+f x+\frac {\pi }{2}\right )^2}{\sqrt {\csc \left (e+f x+\frac {\pi }{2}\right ) a+a}}dx\) |
\(\Big \downarrow \) 4375 |
\(\displaystyle \frac {2 a^2 c \int \frac {\tan ^2(e+f x)}{(\sec (e+f x) a+a) \left (\frac {a \tan ^2(e+f x)}{\sec (e+f x) a+a}+1\right )}d\left (-\frac {\tan (e+f x)}{\sqrt {\sec (e+f x) a+a}}\right )}{f}\) |
\(\Big \downarrow \) 262 |
\(\displaystyle \frac {2 a^2 c \left (-\frac {\int \frac {1}{\frac {a \tan ^2(e+f x)}{\sec (e+f x) a+a}+1}d\left (-\frac {\tan (e+f x)}{\sqrt {\sec (e+f x) a+a}}\right )}{a}-\frac {\tan (e+f x)}{a \sqrt {a \sec (e+f x)+a}}\right )}{f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {2 a^2 c \left (\frac {\arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{a^{3/2}}-\frac {\tan (e+f x)}{a \sqrt {a \sec (e+f x)+a}}\right )}{f}\) |
(2*a^2*c*(ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]]/a^(3/2) - Tan[e + f*x]/(a*Sqrt[a + a*Sec[e + f*x]])))/f
3.1.45.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) ^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ (b*(m + 2*p + 1))) Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b , c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c , 2, m, p, x]
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n _.), x_Symbol] :> Simp[-2*(a^(m/2 + n + 1/2)/d) Subst[Int[x^m*((2 + a*x^2 )^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c + d*x] ]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && I ntegerQ[n - 1/2]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*( d_.) + (c_))^(n_.), x_Symbol] :> Simp[((-a)*c)^m Int[Cot[e + f*x]^(2*m)*( c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && E qQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] && !( IntegerQ[n] && GtQ[m - n, 0])
Time = 3.98 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.41
method | result | size |
default | \(\frac {2 c \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+\cot \left (f x +e \right )-\csc \left (f x +e \right )\right )}{f}\) | \(93\) |
parts | \(\frac {2 c \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )}{f}+\frac {2 c \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\cot \left (f x +e \right )-\csc \left (f x +e \right )\right )}{f}\) | \(111\) |
2*c/f*(a*(sec(f*x+e)+1))^(1/2)*(arctanh(sin(f*x+e)/(cos(f*x+e)+1)/(-cos(f* x+e)/(cos(f*x+e)+1))^(1/2))*(-cos(f*x+e)/(cos(f*x+e)+1))^(1/2)+cot(f*x+e)- csc(f*x+e))
Time = 0.27 (sec) , antiderivative size = 234, normalized size of antiderivative = 3.55 \[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=\left [\frac {{\left (c \cos \left (f x + e\right ) + c\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \, c \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{f \cos \left (f x + e\right ) + f}, -\frac {2 \, {\left ({\left (c \cos \left (f x + e\right ) + c\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + c \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{f \cos \left (f x + e\right ) + f}\right ] \]
[((c*cos(f*x + e) + c)*sqrt(-a)*log((2*a*cos(f*x + e)^2 - 2*sqrt(-a)*sqrt( (a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e) + a*cos(f*x + e) - a)/(cos(f*x + e) + 1)) - 2*c*sqrt((a*cos(f*x + e) + a)/cos(f*x + e)) *sin(f*x + e))/(f*cos(f*x + e) + f), -2*((c*cos(f*x + e) + c)*sqrt(a)*arct an(sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e))) + c*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e))/(f*cos(f*x + e) + f)]
\[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=- c \left (\int \sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )}\, dx + \int \left (- \sqrt {a \sec {\left (e + f x \right )} + a}\right )\, dx\right ) \]
-c*(Integral(sqrt(a*sec(e + f*x) + a)*sec(e + f*x), x) + Integral(-sqrt(a* sec(e + f*x) + a), x))
Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (58) = 116\).
Time = 0.37 (sec) , antiderivative size = 147, normalized size of antiderivative = 2.23 \[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=\frac {\sqrt {a} c \arctan \left ({\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \sin \left (f x + e\right ), {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \cos \left (f x + e\right )\right )}{f} \]
sqrt(a)*c*arctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + sin(f*x + e), (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2 *e) + 1)^(1/4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + cos(f*x + e))/f
\[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=\int { -\sqrt {a \sec \left (f x + e\right ) + a} {\left (c \sec \left (f x + e\right ) - c\right )} \,d x } \]
Timed out. \[ \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx=\int \sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right ) \,d x \]